﻿using BitShuva.Models;
using Raven.Client;
using Raven.Client.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace BitShuva.Controllers
{
    [RoutePrefix("api/artists")]
    public class ArtistsController : UserContextController
    {
        [Route("{artistName}/bio")]
        public async Task<string> GetBio(string artistName)
        {
            var album = await this.Session
                .Query<Album>()
                .FirstOrDefaultAsync(a => a.Artist == artistName);
            return album.ArtistBio;
        }
    }
}
